import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class LeapYear {

	/**
	 * 
	 */
	public static void main(String[] args) {
		int num = 0;
		List list = new ArrayList();
		for (int i = 2017; num <= 100; i++) {
			if (i % 100 == 0) {
				if (i % 400 == 0) {
					list.add(i);
					num++;
				}
			} else if (i % 4 == 0) {
				list.add(i);
				num++;
			}
		}
		Iterator it = list.iterator();
		while (it.hasNext()) {
			Object o = it.next();
			System.out.println(o + "\t");
		}
	}
}
